package models.entities;

import java.util.List;

public class ShoppingCartEntity {
    public List<ShoppingCartItem> items;
    public double subtotal;
    public int count;

    public ShoppingCartEntity(List<ShoppingCartItem> shoppingItems) {
        this.items = shoppingItems;
    }

    public double getSubtotal() {
        double total = 0;
        for (ShoppingCartItem scItem : items) {
            total += scItem.subtotal;
        }
        return total;
    }
}
